package com.shb.jutils.commons;

import java.util.UUID;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class StringUtil {
	/**
	 * 方法名: createUUID 
	 * 返回类型: String
	 * 功能描述：生成一个36位大写的UUID
	 */
	public static String createUUID(){
		return UUID.randomUUID().toString().toUpperCase();
	}
	
	/**
	 * 判断字符串为null或空
	 * @param str
	 * @return
	 */
	public static boolean isNulorEpt(String str){
		if(str == null || "".equals(str.trim())){
			return true;
		}else {
			return false;
		}
	}
	
	public static boolean containsChn(String str){
		String regex = "[\u4e00-\u9fa5]";
		Pattern pattern = Pattern.compile(regex);
		Matcher matcher = pattern.matcher(str);
		if(matcher.find()){
			return true;
		}else{
			return false;
		}
	}
}
